Ext.onReady(function(){
    var processHistoryPanel=Ext.create('component.proces.history',{
        processInstanceId: procInstId,
        minHeight:100,
        colspan: 2,
		contextPath:jypath
   });
	var fileAttachment = Ext.create('component.file.attachment',{
        objectId: id,
        imageType: "6",
        contextPath:jypath,
        colspan:2
   });
   processHistoryPanel.setAutidStatusName(auditStatus);
   processHistoryPanel.setProcesHistoryVisible(processFlag);
	  var fromPanelInfo = Ext.create('Ext.form.FormPanel',{
		   renderTo:Ext.getBody(),
		   titleAlign:'center',
	        title:'认购换房申请',
		    border: true,
		    layout:{
		    	type: 'table',
                columns: 2,
                tableAttrs: {　　
                    border: 1,
                    cellpadding: 5,
                    cellspacing: 1,
                    width: '95%',
                    align: 'center',
                    style: "border:1px solid gray;border-collapse:collapse;margin:0 auto;text-align:center;"
                },
                tdAttrs: {　　
                    width: '100px',
                    height: '40px',
                    style: "padding:5px",
                    valign: 'middle'
                }
		    },
		   items:[
				{
					   xtype:'displayfield',
			    	   fieldLabel:'业务类型',
			    	   name:'businessType',
			    	   width:400
				}, {
					 xtype:'displayfield',
			    	 fieldLabel:'客户姓名',
			    	 name:'customerName',
			    	 width:400
				},{
					 xtype:'displayfield',
			    	 fieldLabel:'已收金额',
			    	 name:'receivables',
			    	 width:400
				},{
					 xtype:'displayfield',
			    	 fieldLabel:'认购日期',
			    	 id:'contractDate',
			    	 width:400
				},{
					 xtype:'displayfield',
			    	 fieldLabel:'原楼盘名称及房号',
			    	 name:'roomCombox',
			    	 width:400
				},{
					 xtype:'displayfield',
			    	 fieldLabel:'原计价面积',
			    	 name:'calculateArea',
			    	 width:400
				},{
					 xtype:'displayfield',
			    	 fieldLabel:'原房屋单价',
			    	 name:'conversionPrice',
			    	 width:400
				},{
					 xtype:'displayfield',
			    	 fieldLabel:'原拆前总价',
			    	 name:'lumpsumPrice',
			    	 width:400
				},{
				
					 xtype:'displayfield',
			    	 fieldLabel:'所换楼盘名称房号',
			    	 name:'newRoomName',
			    	 width:400
				},{
				
					 xtype:'displayfield',
			    	 fieldLabel:'所换计价面积',
			    	 name:'calculateArea1',
			    	 width:400
			    		 
				},{
					 xtype:'displayfield',
			    	 fieldLabel:'所换房屋单价',
			    	 name:'bfdUnitPrice',
			    	 width:400
				},{
					 xtype:'displayfield',
			    	 fieldLabel:'所换折前总价',
			    	 name:'bfdTotalPrice',
			    	 width:400
				},{
					 xtype:'displayfield',
			    	 fieldLabel:'申请日期',
			    	 id:'applyDate',
			    	 width:400
				},{
					xtype : 'displayfield',
					fieldLabel : '换房原因',
					name:'remark',
					width:400
					
				} ,{
					 xtype:'displayfield',
			    	 fieldLabel:'经办人',
			    	 name:'managersName',
			    	 width:400,
			    	 colspan: 2
				},fileAttachment,processHistoryPanel 
			],
			dockedItems: [{
	            xtype: 'toolbar',
	            dock: 'bottom',
	            ui: 'footer',
	            layout: {
	                pack: 'center'
	            },
	            items: [
	            {
					xtype: "button",
					text : "返回",
					id: "btn_back",
					hidden:backBtnHidden,
					name: "btn_back",
					icon : jypath + '/resources/ExtJSicons/shape_move_backwards.png',
					listeners: {
						click: function(){
							 var tabKey = "busDetail_"+id;
							 parent.TabControlRemove(tabKey);
						}
					}
				}]
	        }
	        ]
		   
	   });
	  
	  fromPanelInfo.getForm().load({
			url:jypath+'/marketing/businessAbnorma/loadDetailById',
			params:{'id':id},
			success:function(form, action){
				var obj = action.result.data;
				Ext.getCmp("contractDate").setValue(Ext.Date.format(new Date(obj.contractDate),'Y-m-d'));
				Ext.getCmp("applyDate").setValue(Ext.Date.format(new Date(obj.applyDate),'Y-m-d'));
			},   
			failure: function(form, action) {
		        Ext.Msg.alert("加载失败", action.result.errorMessage);
		    }

		});
	  
});